package test.pool;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectionPool  extends Thread{

	Connection conn = null;
	String driverClassName="com.mysql.jdbc.Driver" ;
	String url="jdbc:mysql://127.0.0.1/smbcrm";
	String username="root";
	String password="123456";
	
	public static void main(String[] args) {
		 
		int p=new ConnectionPool().getConnections().length;
		
		System.out.println (p);
	}

	
	public Connection [] getConnections() {
		Connection [] conns= new Connection[10];
		 try {
			Class.forName( driverClassName);
			 for (int i=0;i<11;i++){
				 conn = DriverManager.getConnection(url,username,password);  
				 conns= new Connection[i];
			 }
			 this.sleep(109200);
			 }
		 catch (Exception e){
			 e.printStackTrace();
		 }
		return conns;
		
	}
	
}
